import jsonp from '@/common/jsonp'

export function getnewslist () {
  const url = 'http://temp.163.com/special/00804KVA/cm_guonei.js'
  const options = {
    name: 'data_callback'
  }
  const data = {}
  return jsonp(url, data, options)
}

export function getnewsinfo (id) {
  const url = 'http://sdk.comment.163.com/api/v1/products/a2869674571f77b5a0867c3d71db5856/threads/' + id
  const options = {}
  const data = {
    ibc: 'jssdk'
  }
  return jsonp(url, data, options)
}

export function getnewscomment (id) {
  const url = `http://comment.news.163.com/api/v1/products/a2869674571f77b5a0867c3d71db5856/threads/${id}/comments/hotList`
  const options = {
    param: 'callback',
    name: 'getData'
  }
  const data = {
    offset: 0,
    limit: 40,
    showLevelThreshold: 72,
    headLimit: 1,
    tailLimit: 2,
    ibc: 'newspc'
  }
  return jsonp(url, data, options)
}
